<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/template.xhtml">
	<ui:define name="content">
		<h:form>
			<div class="middle">
				<h:messages class="myError" id="errors" />
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h3>
					<h:outputText value="#{msg.OM_printerReport_status}" />
				</h3>

				<h3 align="center">
					<h:outputText value="#{printersBean.message}"></h:outputText>
				</h3>

				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h:outputFormat value="#{printersBean.date}">
					<f:convertDateTime pattern="dd.MM.yyyy" />
				</h:outputFormat>
			</div>

			<h:dataTable class="table" value="#{printersBean.listVals}"
				var="printer">
				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_devicename}"></h:outputText>
					</f:facet>
					<h:outputText class="td" value="#{printer.res.name}"></h:outputText>
				</h:column>

				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_nrofpages}"></h:outputText>
					</f:facet>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.zero and !printer.zeroNrPage}"
						value="#{printer.valPages}"></h:outputText>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.allzero}" value="-"></h:outputText>
					<h:outputText class="td"
						rendered="#{!printer.zero and !printer.allzero and !printer.zeroNrPage}"
						value="#{printer.valPages} "></h:outputText>
					<h:outputText class="td" rendered="#{printer.zeroNrPage}"
						value="No pages printed"></h:outputText>
				</h:column>

				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_black}"></h:outputText>
					</f:facet>
					<h:outputText class="blinkytextprinter" rendered="#{printer.zero}"
						value="#{printer.valBlack} %"></h:outputText>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.allzero}" value="-"></h:outputText>
					<h:outputText class="td"
						rendered="#{!printer.zero and !printer.allzero}"
						value="#{printer.valBlack} %"></h:outputText>
				</h:column>
				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_cyan}"></h:outputText>
					</f:facet>
					<h:outputText class="blinkytextprinter" rendered="#{printer.zero}"
						value="#{printer.valCyan} %"></h:outputText>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.allzero}" value="-"></h:outputText>
					<h:outputText class="td"
						rendered="#{!printer.zero and !printer.allzero}"
						value="#{printer.valCyan} %"></h:outputText>
				</h:column>
				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_magenta}"></h:outputText>
					</f:facet>
					<h:outputText class="blinkytextprinter" rendered="#{printer.zero}"
						value="#{printer.valMagent} %"></h:outputText>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.allzero}" value="-"></h:outputText>
					<h:outputText class="td"
						rendered="#{!printer.zero and !printer.allzero}"
						value="#{printer.valMagent} %"></h:outputText>
				</h:column>
				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_yellow}"></h:outputText>
					</f:facet>
					<h:outputText class="blinkytextprinter" rendered="#{printer.zero}"
						value="#{printer.valYellow} %"></h:outputText>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.allzero}" value="-"></h:outputText>
					<h:outputText class="td"
						rendered="#{!printer.zero and !printer.allzero}"
						value="#{printer.valYellow} %"></h:outputText>
				</h:column>

				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="#{msg.OM_printerReport_ip}"></h:outputText>
					</f:facet>
					<h:outputText class="blinkytextprinter" rendered="#{printer.zero}"
						value="#{printer.res.ip} "></h:outputText>
					<h:outputText class="blinkytextprinter"
						rendered="#{printer.allzero}" value="#{printer.res.ip}"></h:outputText>
					<h:outputText class="td"
						rendered="#{!printer.zero and !printer.allzero}"
						value="#{printer.res.ip} "></h:outputText>
				</h:column>

				<h:column>
					<f:facet class="th" name="header">
						<h:outputText value="Ping"></h:outputText>
					</f:facet>
					<h:commandButton class="button" type="submit" value="Ping"
						actionListener="#{printersBean.getIpPrinterListener}">
						<f:attribute name="ip" value="#{printer.res.ip}" />
					</h:commandButton>
				</h:column>

			</h:dataTable>

			<h:outputFormat>
				<center>
					<font size="2px"><h:outputText
							value="#{msg.OM_printerReport_value}"></h:outputText></font>
				</center>
			</h:outputFormat>

			<h:outputText value="&lt;br/&gt;" escape="false" />
			<h:outputText value="#{printersBean.mpb.page}" rendered="false"></h:outputText>


		</h:form>
	</ui:define>
</ui:composition>
</html>